import mitt from 'mitt'

type Events = {
  // 定义你的事件类型示例：
  'component-selected': Record<string, unknown>
  'property-updated': { key: string, value: unknown }
  // 添加更多具体事件类型...
}

const emitter = mitt<Events>()

export default defineNuxtPlugin(() => {
  return {
    provide: {
      bus: {
        emit: emitter.emit,
        on: emitter.on,
        off: emitter.off
      }
    }
  }
})
